package net.apexes.demo.codegen.ormlite.column;

import net.apexes.commons.ormlite.Column;
import net.apexes.commons.ormlite.Index;
import net.apexes.demo.codegen.ormlite.column.base.QEntityBase;
import net.apexes.demo.codegen.ormlite.entity.PaymentItemInfo;

/**
 * QPaymentItemInfo is a ORMLite query type for PaymentItemInfo
 * @see PaymentItemInfo
 */
public class QPaymentItemInfo extends QEntityBase<PaymentItemInfo> {

    public static final QPaymentItemInfo $ = new QPaymentItemInfo("PAYMENT_ITEM_INFO");

    public final Column infoKey = field("infoKey").columnName("INFO_KEY").varchar(32).notNull().build();

    public final Column infoValue = field("infoValue").columnName("INFO_VALUE").varchar(64).notNull().build();

    public final Column shopId = field("shopId").columnName("SHOP_ID").varchar(22).notNull().build();

    public class Indexs {

        public final Index primaryKeyF4 = index("PRIMARY_KEY_F4").unique().column(id).build();

    }

    public final Indexs ix = new Indexs();

    public QPaymentItemInfo(String tableName) {
        super(PaymentItemInfo.class, tableName);
    }

    @Override
    public PaymentItemInfo newInstance() {
        return new PaymentItemInfo();
    }

    @Override
    public Object getFieldValue(PaymentItemInfo instance, String fieldName) {
        switch (fieldName) {
            case "infoKey":
                return instance.getInfoKey();
            case "infoValue":
                return instance.getInfoValue();
            case "shopId":
                return instance.getShopId();
            default:
                return super.getFieldValue(instance, fieldName);
        }
    }

    @Override
    public void setupFieldValue(PaymentItemInfo instance, String fieldName, Object value) {
        switch (fieldName) {
            case "infoKey":
                instance.setInfoKey((java.lang.String) value);
                break;
            case "infoValue":
                instance.setInfoValue((java.lang.String) value);
                break;
            case "shopId":
                instance.setShopId((java.lang.String) value);
                break;
            default:
                super.setupFieldValue(instance, fieldName, value);
                break;
        }
    }

}

